
#ifndef __VERTEX_H__
#define __VERTEX_H__

#include "Color.h"
#include "Real3.h"
#include "Real2.h"

class Vertex
{
public:

	// Constructor
	Vertex() {}
	Vertex(Real3 _position, Real3 _normal, Real2 _tex = Real2(0.0f, 0.0f), Color _color = __white)
	{
		position = _position;
		normal = _normal;
		#ifdef USE_TEX
		tex = _tex;
		#endif
		#ifdef USE_COLOR
		color = _color;
		#endif
	}

	// Coordinates
	Real3 position;
	Real3 normal;

	// Color
	#ifdef USE_COLOR
	Color color;
	#endif

	// Texture
	#ifdef USE_TEX
	Real2 tex;
	#endif
};

#ifdef USE_TEX
	#ifdef USE_COLOR
	#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX1)
	#else
	#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1)
	#endif
#else
	#ifdef USE_COLOR
	#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE)
	#else
	#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ | D3DFVF_NORMAL)
	#endif
#endif

class Line
{
public:

	// Constructor
	Line() {}
	Line(const Real3 &_a, const Real3 &_b)
	{
		a = _a;
		b = _b;
	}

	// Set
	void Set(const Real3 &_a, const Real3 &_b)
	{
		a = _a;
		b = _b;
	}

	// Variables
	Real3 a;
	Real3 b;
};

#endif // __VERTEX_H__